package com.patrol.inspection.Service;

import com.patrol.inspection.Entity.testObject;
import com.patrol.inspection.Utils.JsonUtils;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;

@Service
public class KafkaService {
//
    @KafkaListener(topics = "npl_res", groupId = "npl-res")
    public void listen(String message) {
        System.out.println("Received message: " + message);
        testObject identifyObject = JsonUtils.convertJsonToObject(message, testObject.class);
        System.out.println("Received message: " + identifyObject);
    }
}
